package com.bankfourfactor;


/**
 * 实时付款返回码
 * 
 */
public enum RetCodeEnum {

	
	
	
	
	UDCARDSUCC("udcard","1","鉴权成功","1"),
	UDCARDERROR("udcard","2","鉴权失败","2");



	public final String code;

	public final String msg;

	public final String desc;
	
	public final String orgCode;
	

	RetCodeEnum(String orgCode,String code, String msg, String desc) {
		this.code = code;
		this.msg = msg;
		this.desc = desc;
		this.orgCode=orgCode;
	}

	public static RetCodeEnum getRetCodeEnumByValue(String orgCode,String value) {
		for (RetCodeEnum retCodeEnum : RetCodeEnum.values()) {
			if (retCodeEnum.getCode().equals(value)&&retCodeEnum.getOrgCode().equals(orgCode)) {
				return retCodeEnum;
			}
		}
		return null;
	}

//	/**
//	 * 判断返回code是否需要调用付款查询结果
//	 * 
//	 * @param trade_code
//	 * @return
//	 */
//	public static boolean isNeedQuery(String trade_code) {
//		if (trade_code.equals(ORDER_REPEAT_ERROR.code) || trade_code.equals(ORDER_REPEAT_SUBMIT.code)
//				|| trade_code.equals(ENCRYPT_ERROR.code) || trade_code.equals(DESCRYPT_ERROR.code)
//				|| trade_code.equals(CONFIRM_CODE_ERROR.code)||trade_code.equals(SYSTEM_ERROR.code)) {
//			return true;
//		}
//		return false;
//
//	}
	
	public String getCode() {
		return code;
	}

	public String getMsg() {
		return msg;
	}

	public String getDesc() {
		return desc;
	}

	public String getOrgCode() {
		return orgCode;
	}

}
